<?php
class Config extends CI_Controller {

    //构造函数
    public function __construct()
    {
		parent::__construct();
	    $this->load->model('Admin/Configm');
	}

    //系统设置列表显示
	public function index()
	{
        $this->Configm->index();
	}

	//系统系统设置信息修改
	public function update()
	{
		$this->Configm->update();
	}

	//上传图片
	public function upload()
	{
		$this->Configm->upload();
	}

	//添加系统设置
	public function add()
	{
		$this->Configm->add();
	}

	//系统设置请求接口
	public function configurl()
	{
		$sql = "select value from mifi_config where name = 'dns'";
		$config = $this->db->query($sql)->result_array();
		if($config){
			echo json_encode(['code'=>1,'data'=>$config[0]['value']]);
		}else{
			echo json_encode(['code'=>0,'infomsg'=>'网站域名未设置,请前往设置']);
		}	
	}

    //短信设置列表显示
    public function smsinfo()
    {
    	$this->Configm->smsinfo();
    }

	//短信名称显示
	public function smsname()
	{
		$this->Configm->smsname();
	}

	//添加短信设置
	public function addsms()
	{
		$this->Configm->addsms();
	}

	//修改短信设置
	public function updatesms()
	{
		$this->Configm->updatesms();
	}

	//模板设置列表
	public function smslist()
	{
		$this->Configm->smslist();
	}

	//编辑模板内容显示
	public function editsmslist()
	{
		$this->Configm->editsmslist();
	}

	//修改模板设置状态
	public function status()
	{
		$this->Configm->status();
	}

	//编辑模板设置
	public function editsms()
	{
		$this->Configm->editsms();
	}

	//单条记录删除短信模板
	public function del()
	{
		$this->Configm->del();
	}

	//批量删除短信模板
	public function delall()
	{
		$this->Configm->delall();
	}
}
